#ifndef _AboutWin_h_
#define _AboutWin_h_

// My creation:  Allows easier cloning of window pages
#define WINNAME AboutWin

/*
  About window with some features: Remembers position, modeless so can leave open, copyable information
*/
#include "PowerWindow.h" // Contains TopWindow

// U++ connection
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

//============================================================================================================================
class WINNAME : public WithAboutLayout<PowerWindow> {

public:

	typedef WINNAME CLASSNAME;
	 
	//============================================================================================================================
	WINNAME() {
		RTIMING(String().Cat() << "Creating " << QUOTEME(WINNAME));
		// Following must be in constructor or will abort on 2nd open
		CtrlLayout(*this);
	}

	//============================================================================================================================
	~WINNAME() {
		RTIMING(String().Cat() << "Destroying " QUOTEME(WINNAME));
	}

	// SPEED: Note: Moved from constructor to open and increased  load time by about 50-100 ms (hard to measure)
	//============================================================================================================================
	void Open() {

		// Note that controls are text so that they can be user copied and selected
		productName.SetText("Jammit 1.0");
		IDEName.SetText("IDE: Ultimate++ 1952 Mirek Fídler, Tomáš Rylek, Daniel Kos");
		compilerName.SetText("Compiler: Microsoft Visual C++ 2010 v16.00.21003.01 80x86");
		authorName.SetText("Author: Jeff Humphreys jeffshumphreys@gmail.com");
		mp3LibraryName.SetText("MP3 Decoder: libwmp3 2.51 July 9th, 2009 Zoran Cindori");
		quotation.SetText("the play's the thing");
		String lic =
			"[0 DISCLAIMER&&"
			"This program is distributed as freeware. This software is provided \"as is\", without any guarantee "
			"made as to its suitability or fitness for any particular use`. It may contain bugs`, "
			"so use of this tool is at your own risk`. Author takes no responsibility for any damage that may unintentionally "
			"be caused through its use`.&"
			"&License`:&&"
			"This program is free software`; you can redistribute it and`/or modify it under the "
			"terms of the GNU General Public License as published by the Free Software Foundation`; either version "
			"2 of the License, or (at your option) any later version. This program is distributed in the hope that it "
			"will be useful`, but WITHOUT ANY WARRANTY`; without even the implied warranty of MERCHANTABILITY or FITNESS "
			"FOR A PARTICULAR PURPOSE`. See the GNU General Public License for more details`.&"
			"]";
		productLicense.SetData(lic);
		PowerWindow::Open("aboutwin");
	}

	//============================================================================================================================
	void Close() {
		// Serialize, mostly position information
		PowerWindow::Close("aboutwin");  // Make sure to call PowerWindow close and not directly call TopWindow or else configuration is not saved possibly until application closes
	}
	
	//============================================================================================================================
	virtual void Xmlize(XmlIO xml) {
		
	}
	
};

#endif
